<%--
  Created by IntelliJ IDEA.
  User: yz168
  Date: 2021/9/1
  Time: 9:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>产品修改</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css"
          integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous">
    </script>
</head>
<style>
    .content {
        margin-left: 180px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
</style>
<body>
<div class="content">
    <form action="${pageContext.request.contextPath}/doEditProduct.action" method="post">
        <table>
            <tr>
                <td>产品编号</td>
                <td><input class="form-control" type="number" name="productId" value="${product.productId}" readonly/></td>
            </tr>
            <tr>
                <td>产品名称</td>
                <td><input class="form-control" type="text" name="productName" value="${product.productName}"/></td>
            </tr>
            <tr>
                <td>进货价格</td>
                <td><input class="form-control" type="number" name="incomePrice" value="${product.incomePrice}"/></td>
            </tr>
            <tr>
                <td>销售价格</td>
                <td><input class="form-control" type="number" name="salesPrice" value="${product.salesPrice}"/></td>
            </tr>
            <tr>
                <td>商品数量</td>
                <td><input class="form-control" type="number" name="quantity" value="${product.quantity}"/></td>
            </tr>
            <tr>
                <td>分类</td>
                <td>
                    <select name="categoryId" class="form-control">
                        <option value="0">--请选择--</option>
                        <c:forEach items="${categorys}" var="category">
                            <option value="${category.categoryId}"
                                    <c:if test="${category.categoryId==product.categoryId}">
                                        selected
                                    </c:if>
                            >${category.categoryName}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>供应商</td>
                <td>
                    <select name="providerId" class="form-control">
                        <option value="0">--请选择--</option>
                        <c:forEach items="${providers}" var="provider">
                            <option value="${provider.providerId}"
                                    <c:if test="${provider.providerId==product.providerId}">
                                        selected
                                    </c:if>
                            >${provider.providerName}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>进货时间</td>
                <td><input class="form-control" type="date" name="incomeTime" value="${product.incomeTime}"/></td>
            </tr>
            <tr>
                <td><input class="btn btn-info" type="submit" name="btnsubmit" value="保存" /></td>
                <td><input class="btn btn-info" type="reset" name="btnreset" value="重置" /></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
